﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace DomusDotNet.Sbm.ObjectModel
{
    public class Book : BaseObject
    {
        public Book()
        {
            ////Every book has almost one author.
            this.Authors = new List<Author>(1);
        }

        [Required]
        public virtual string ISBN
        {
            get;
            set;
        }

        [Required]
        public virtual string Title
        {
            get;
            set;
        }

        public virtual int Version
        {
            get;
            set;
        }

        public virtual int Volume
        {
            get;
            set;
        }

        [Required]
        public virtual Editor Editor
        {
            get;
            set;
        }

        [Required]
        public virtual Member Member
        {
            get;
            set;
        }

        public virtual IList<Author> Authors
        {
            get;
            set;
        }

        [Required]
        public virtual bool Available
        {
            get;
            set;
        }

        public virtual DateTime? PublishDate
        {
            get;
            set;
        }
    }
}
